﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataBase
{

    /// <summary>
    /// 对数据库的操作
    /// <para>增、删，改、查</para>
    /// </summary>
    public interface IDBHandle<T>:IDBRead<T>
    {
        /// <summary>
        /// 增加一条数据
        /// </summary>
        bool Add(T entity);

        /// <summary>
        /// 更新一条数据
        /// </summary>
        int Update(T entity);

        /// <summary>
        /// 删除一条数据
        /// </summary>
        /// <param name="where">删除数据所需要的条件</param>
        int Delete(object where);

        /// <summary>
        /// 删除整个表的数据
        /// </summary>
        /// <returns></returns>
        bool DeleteAll()
    }
}
